﻿<Window x:Class="GDStashViewer.SettingsWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:GDStashViewer" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:properties="clr-namespace:GDStashViewer.Properties" Title="Settings" Width="600" Height="400"
				Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
				Closed="Window_Closed" ResizeMode="CanResize" WindowStartupLocation="CenterOwner" WindowStyle="ToolWindow" mc:Ignorable="d">
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="*" />
			<RowDefinition Height="auto" />
		</Grid.RowDefinitions>
		<TabControl>
			<TabItem Header="General">
				<Grid Margin="4">
					<Grid.ColumnDefinitions>
						<ColumnDefinition MinWidth="200" />
						<ColumnDefinition MinWidth="200" />
						<ColumnDefinition Width="auto" />
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="*" />
						<RowDefinition Height="auto" />
					</Grid.RowDefinitions>
					<Grid.Resources>
						<Style TargetType="TextBlock">
							<Setter Property="TextWrapping" Value="Wrap" />
							<Setter Property="VerticalAlignment" Value="Center" />
						</Style>
						<Style TargetType="TextBox">
							<Setter Property="Grid.Column" Value="1" />
							<Setter Property="VerticalAlignment" Value="Center" />
						</Style>
					</Grid.Resources>

					<TextBlock Grid.Row="1" Margin="2,4" Text="Extracted GD Database Root Folder" />
					<TextBox Grid.Row="1" Text="{Binding Source={x:Static properties:Settings.Default}, Path=ExtractedRootFolder}" />
					<Button x:Name="browseFolderButton" Grid.Row="1" Grid.Column="3" Width="20" MinWidth="20" Margin="0,2,2,2" HorizontalAlignment="Right" Click="browseFolderButton_Click" Content="..." VerticalAlignment="Center" />
<TextBlock Grid.Row="2" Margin="2,4" Text="GD Resource Folder, e.g. 'SteamInstallFolder\steamapps\common\Grim Dawn\resources\text_en (Must contain 'tags_*.txt' files) " />
					<TextBox Grid.Row="2" Text="{Binding Source={x:Static properties:Settings.Default}, Path=ResourceFolder}" />
					<Button x:Name="browseResFolderButton" Grid.Row="2" Grid.Column="3" Width="20" MinWidth="20" Margin="0,2,2,2" HorizontalAlignment="Right" Click="browseResFolderButton_Click" Content="..." VerticalAlignment="Center" />
					<!--<TextBlock Grid.Row="2" Margin="2,4" Text="Extracted Items Name File ('tags_items.txt')" />
					<TextBox Grid.Row="2" Text="{Binding Source={x:Static properties:Settings.Default}, Path=ItemTagFile}" />
					<Button x:Name="browseFileButton" Grid.Row="2" Grid.Column="3" MinWidth="20" Margin="0,2,2,2" HorizontalAlignment="Right" Click="browseItemTagFileButton_Click" Content="..." />-->

					<TextBlock Grid.Row="3" Margin="2,4" Text="(Optional) Location GD StashManager's List.cfg file" />
					<TextBox Grid.Row="3" Text="{Binding Source={x:Static properties:Settings.Default}, Path=ListCfgFile}" />
					<CheckBox Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="4" Margin="2" Content="Resolve Item Affixes (Prefix and Suffix) for all items" IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=ShouldResolveAffixes}" />
					<CheckBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4" Margin="2" Content="Use Alternate Formatting for Item Affixes e.g. 'Item Name,Prefix,Affix'" IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=UseAlternateAffixFormat}" />

					<Button x:Name="browseListCfgFileButton" Grid.Row="3" Grid.Column="3" MinWidth="20" Margin="0,2,2,2" HorizontalAlignment="Right" Click="browseListCfgFileButton_Click" Content="..." />
				</Grid>
			</TabItem>
			<TabItem Header="Export">
				<Grid Margin="4">
					<Grid.ColumnDefinitions>
						<ColumnDefinition MinWidth="200" />
						<ColumnDefinition MinWidth="200" />
					</Grid.ColumnDefinitions>
					<Grid.RowDefinitions>
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="auto" />
						<RowDefinition Height="*" />
						<RowDefinition Height="auto" />
					</Grid.RowDefinitions>
					<Grid.Resources>
						<Style TargetType="TextBlock">
							<Setter Property="Margin" Value="2,3" />
							<Setter Property="TextWrapping" Value="Wrap" />
							<Setter Property="VerticalAlignment" Value="Center" />
						</Style>
						<Style TargetType="TextBox">
							<Setter Property="AcceptsReturn" Value="True" />
							<Setter Property="AcceptsTab" Value="True" />
							<Setter Property="Grid.Column" Value="1" />
							<Setter Property="Margin" Value="2" />
							<Setter Property="VerticalAlignment" Value="Center" />
						</Style>
					</Grid.Resources>
					<TextBlock Grid.Row="0" Text="Item Format: {0}=Name, {1}=Category, {2}=Sub Cat., {3}=Lev Req, {4}='*Count' (when Duplicates are Ignored), {5}=URL" />
					<TextBox Grid.Row="0" Text="{Binding Source={x:Static properties:Settings.Default}, Path=ExportFormat}" />
					<TextBlock Grid.Row="1" Text="Group Header: {0}=Name, {1}=Count" />
					<TextBox Grid.Row="1" Text="{Binding Source={x:Static properties:Settings.Default}, Path=ExportGroupFormat}" />
					<TextBlock Grid.Row="2" Text="Group Footer. Tip: Use to close tags" />
					<TextBox Grid.Row="2" Text="{Binding Source={x:Static properties:Settings.Default}, Path=ExportGroupFooterFormat}" />
					<TextBlock Grid.Row="3" Text="Header: {0}=Time" />
					<TextBox Grid.Row="3" Text="{Binding Source={x:Static properties:Settings.Default}, Path=ExportHeaderFormat}" />
					<TextBlock Grid.Row="4" Text="Footer: {0}=Time" />
					<TextBox Grid.Row="4" Text="{Binding Source={x:Static properties:Settings.Default}, Path=ExportFooterFormat}" />
					<CheckBox Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4" Margin="2" Content="Indent Nested Groups and Items" IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=ExportUseIndent}" />
					<CheckBox Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4" Margin="2" Content="Ignore Grouping; Always Export Flat List" IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=ExportShouldIgnoreGrouping}" />
					<CheckBox Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="4" Margin="2" Content="Ignore Duplicate Item Names" IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=ExportShouldIgnoreDuplicates}" />
					<CheckBox Grid.Row="8" Grid.Column="0" Grid.ColumnSpan="4" Margin="2" Content="Ignore 'Don't Export' column; export all items regardless of flag" IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=ExportShouldIgnoreDontExport}" />
					<TextBlock Grid.Row="9" Grid.ColumnSpan="4" Background="{DynamicResource {x:Static SystemColors.InfoBrushKey}}" Foreground="{DynamicResource {x:Static SystemColors.InfoTextBrushKey}}" Text="Tip: Enter (Line Break) and Tabs are accepted in textboxes. Putting a space (as a place holder) will yeild a line break" />
				</Grid>
			</TabItem>
		</TabControl>
		<StackPanel Grid.Row="5" Margin="0,2,2,2" HorizontalAlignment="Right" Orientation="Horizontal">
			<Button x:Name="defaultsButton" MinWidth="60" Margin="4" HorizontalAlignment="Right" Click="defaultsButton_Click">Defaults</Button>
			<Button x:Name="cancelButton" MinWidth="60" Margin="4" HorizontalAlignment="Right" Click="cancelButton_Click" IsCancel="True">Cancel</Button>
			<Button x:Name="okButton" MinWidth="60" Margin="4" HorizontalAlignment="Right" Click="okButton_Click">Ok</Button>
		</StackPanel>
	</Grid>
</Window>